-------------------------------------------------------------------------------
-- FILE: fir_pack.vhd
-- DESCRIPTION: This package declares the constants to be used throughout the
-- design process. All modifications concerning wordlength, filter order, filter
-- structure, etc. have to be done here!
-------------------------------------------------------------------------------

  library ieee;
  use ieee.std_logic_1164.all;
  use work.components_pack.all;

  package fir_pack is

    -- Path to data files
    constant PATH         : string                := "C:\Users\Kaiser\Desktop\VHDL\Assignment 2 - FIR\Matlab\Data\";		-- "C:\Work\Lab 2\FIR\Matlab\Data\";
    -- Input stimuli file
    constant STIMULI_FILE : string                := PATH & "input.dat";

    -- Output trace file
--      constant TRACE_FILE   : string              := PATH & "vhdl_output.dat";
    constant TRACE_FILE   : string              := PATH & "vhdl_pipelined_output.dat";
    
    
    -- Self-explanary
    type     structure_type is (DIRECT, PIPELINED);
    
    -- Choose a structure here
--      constant STRUCTURE   : structure_type        := DIRECT;
    constant STRUCTURE     : structure_type        := PIPELINED;
  

    
    -- Half a clock period 
    constant PULSEWIDTH   : time                  := 20 ns;
    -- Propagation delay
    constant DELAY        : time                  := 2 ns;
    -- Reset on startup
    constant RESET_TIME   : time                  := 100 ns;
    -- Filter order
    constant M            : integer               := 15;
    -- Input wordlength
    constant INPUT_WIDTH  : integer               := 8;
    -- Coefficient wordlength
    constant COEFF_WIDTH  : integer               := 7;
    -- Output wordlength
    constant OUTPUT_WIDTH : integer               := INPUT_WIDTH+COEFF_WIDTH+M;
    
    constant PIPELINE_STAGE: integer              := 6;
    
    -- Type definition for the impulse response
    type     impulse_response_type is array (0 to M) of integer;
    
    -- Example impulse response
    constant H            : impulse_response_type := (-1, 0, 1, -3, -9, -2, 30, 63, 63, 30, -2, -9, -3, 1, 0, -1);

  end fir_pack;
